package com.roy;

import net.sourceforge.tess4j.ITesseract;
import net.sourceforge.tess4j.Tesseract;
import net.sourceforge.tess4j.TesseractException;

import java.io.File;

/**
 * @author ：楼兰
 * @date ：Created in 2021/1/14
 * @description:
 **/

public class Tess4jDemo {
    public static void main(String[] args) throws TesseractException {
        ITesseract instance = new Tesseract();
        instance.setDatapath("D:\\tessdata");
        instance.setLanguage("chi_sim");

        File imageLocation = new File("D:\\verifyCode");
        for(File image: imageLocation.listFiles()){
            System.out.println(image.getName()+">>>"+instance.doOCR(image));
        }
    }
}
